package com.guigu.pd.auth.dao;

import com.guigu.pd.auth.entity.AuthMenuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 
 * 
 * @author deyran
 * @email deyran@gmail.com
 * @date 2022-07-19 19:05:57
 */
@Mapper
public interface AuthMenuDao extends BaseMapper<AuthMenuEntity> {

 /*   @Select("SELECT pam.* FROM pd_auth_menu pam LEFT JOIN pd_auth_resource pare ON  pare.menu_id " +
            "= pam.id \n" +
            "LEFT JOIN `pd_auth_role_authority` para ON para.authority_id = pare.id \n" +
            "LEFT JOIN `pd_auth_role` par ON par.id = para.role_id \n" +
            "LEFT JOIN `pd_auth_user_role` paur  ON paur.role_id = par.id \n" +
            "LEFT JOIN `pd_auth_user` pau ON pau.id = paur.user_id WHERE pau.id = 11111111")*/
    @Select("SELECT * FROM pd_auth_menu")
    public List<AuthMenuEntity> findAllMenus();

    List<AuthMenuEntity> menusQbXxyiji();

    @Update("UPDATE pd_auth_menu SET is_enable=b'0' WHERE id=#{id}")
    public int delmenu(int id);

    @Select("select * from pd_auth_menu where parent_id = #{id}")

    List<AuthMenuEntity> menusQbXxerji(String id);
}
